/*
 * @(#)AccountDaoImpl.java 1.0 2010-3-8
 *
 * Copyright 2009 NetQin , Inc. All rights reserved.
 */
package com.netgo.dao.ibatis;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.netgo.account.Account;
import com.netgo.dao.AccountDao;

/**
 * @author wangajing
 * @version 1.0,2010-3-8
 * @see
 * @since 1.0 
 *
 */
public class AccountDaoImpl extends SqlMapClientDaoSupport implements AccountDao {
	
	
	/* (non-Javadoc)
	 * @see com.netgo.dao.AccountDao#addAccount(com.netgo.account.Account)
	 */
	@Override
	public void addAccount(Account account) throws DataAccessException {
		this.getSqlMapClientTemplate().insert("Account.addAccount",account);
		
	}
	/* (non-Javadoc)
	 * @see com.netgo.dao.AccountDao#updateAccount(com.netgo.account.Account)
	 */
	@Override
	public void updateAccount(Account account) throws DataAccessException {
		this.getSqlMapClientTemplate().update("Account.updateAccount",account);
	}
	/* (non-Javadoc)
	 * @see com.netgo.dao.AccountDao#getAccount(com.netgo.account.Account)
	 */
	@Override
	public Account getAccount(Account account) throws DataAccessException {
		return (Account)(this.getSqlMapClientTemplate().queryForObject("Account.queryForAccount",account));
	}
	
}
